﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WPF_PathSearchUtil.entity
{
    public class PathInfo
    {
        private String fileName;
        private String filePath;
        private String fileType;
        private Double fileSize;
        private DateTime fileDate;

        public PathInfo()
        {

        }

        public PathInfo(string fileName, string filePath, string fileType, double fileSize, DateTime fileDate)
        {
            this.fileName = fileName;
            this.filePath = filePath;
            this.fileType = fileType;
            this.fileSize = fileSize;
            this.fileDate = fileDate;
        }

        public string FileName { get => fileName; set => fileName = value; }
        public string FilePath { get => filePath; set => filePath = value; }
        public string FileType { get => fileType; set => fileType = value; }
        public double FileSize { get => fileSize; set => fileSize = value; }
        public DateTime FileDate { get => fileDate; set => fileDate = value; }

        public override bool Equals(object obj)
        {
            return obj is PathInfo info &&
                   fileName == info.fileName &&
                   filePath == info.filePath &&
                   fileType == info.fileType &&
                   fileSize == info.fileSize &&
                   fileDate == info.fileDate;
        }

        public override int GetHashCode()
        {
            int hashCode = -1166879264;
            hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(fileName);
            hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(filePath);
            hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(fileType);
            hashCode = hashCode * -1521134295 + fileSize.GetHashCode();
            hashCode = hashCode * -1521134295 + fileDate.GetHashCode();
            return hashCode;
        }

        public override string ToString()
        {
            return base.ToString();
        }
    }
}
